import http from "../index";

// 系统管理员查询
export const getTextFile = (data) =>
	http({
		url: "/api/document/getDocumentByAdmin",
		method: "post",
		data,
	});
// 企业管理员查询
export const getDocumentByCompany = (data) =>
	http({
		url: "/api/document/getDocumentByCompany",
		method: "post",
		data,
	});
// 新增
export const addDocument = (data) =>
	http({
		url: "/api/document",
		method: "post",
		data,
	});

// 编辑
export const updateDocument = (data) =>
	http({
		url: "/api/document",
		method: "put",
		data,
	});

// 删除
export const deleteDocument = (params) =>
	http({
		url: "/api/document/?" + params,
		method: "delete",
	});

//批量删除
export const deleteBatchDocument = (data) =>
	http({
		url: "/api/document/deleteBatch",
		method: "delete",
		data,
	});

//上传文档
export const upload = (data) =>
	http({
		url: "/api/document/uploadDocument",
		method: "post",
		data,
	});

// 根据类型和时间排序查询文档
export const getDocumentOrderByType = () =>
	http({
		url: "/api/document/getDocumentOrderByType",
		method: "get",
	});

// 根据类型和时间排序查询文档
export const getByInput = (params) =>
	http({
		url: "/api/document/getDocumentByInput?" + params,
		method: "get",
	});

//下载文档
export const downLoad = (params) =>
	http({
		url: "/api/document/download?" + params,
		method: "get",
	});

//其他人员查询
export const getDocumentWithOtherByInput = (params) =>
	http({
		url: "/api/document/getDocumentWithOtherByInput?" + params,
		method: "get",
	});